package core;

import java.util.Random;


public class Core 
{
	private static Random cRnd = new Random();

	public static int dice(int eyes, int num)
	{
		int result = 0;
		for (int t=num; t > 0 ; t --)
		{
			result += cRnd.nextInt(eyes) +1 ;
		}
		return result;
	}
	public static int nextInt(int a)
	{
		return cRnd.nextInt(a);
	}
	// Roll a open dice, will re-roll and add if dice <= addRoll
	public static int unlimitedDice(int eyes, int addRoll)
	{
		int res = dice(eyes,1);
		if (res <= addRoll)
			res +=unlimitedDice(eyes, addRoll);
		return res;
	}

}




